Put update not working properly