fixed bugs in put