(the start of) better error messaging, fixed some weird session bug (refactoring for next commit)