added update entity method and test