added put logic