change HANDLE_CAUSE into a function.