return error instead of panic
Merge pull request #10 from mnlg/do-not-panic

Return error instead of panic