Adjusted put method to add key value pair