maybe we could move the try-catch block po so that the exception you threw at line 30 will still be caught. 
```PHP
try {
	switch ($page) {
		case 'register':
			break;
		case 'register_end':
			$account->username = $username;
			$account->password = $password;
			$account->repassword = $repassword;
			$user_id = $thread->register($account);
			break;
		default:
			throw new NotFoundException("{$page} is not found");
		break;
	}
} catch (ValidationException $e) {
	$page = 'register';
} catch (NotFoundException $e) {
	$error = $e->getMessage();
}
```