fixing PUT function