retrieve not working properly