better error handling

Signed-off-by: Walker Crouse <walkercrouse@hotmail.com>