fixed error in reset_element