fixed error in check_formals