fixed the cost on update and create and nullpointer on update