rudimentary exception handling