changing update method to remove bug