adding better error output