Updated PUT function