Fixed issues with getting wrong items from database