clean up hook and view variable