moved _clear call in handle_request to end of subroutine