fixing minor bug + bettor error output at error case