added type check in put