identify error in final function