Please post your code.
What do you mean by
it doesn't save in correct location, but other location
I haven't heard of an issue where data is getting saved to the wrong location so, maybe give us some more information to work with to help you out.
The issue has been fixed. It was ejb query. since a few words of input worked perfectly fine, I didn't suspect ejb query.