fixed errors where maximum call stack would be exceeded or after update error