Fixed problems with create and update