added positive and negative tests for error handling