cleanup: use function to display error and return instead of pass