update and debug