moved sql related errors to DML later, fixed resulting bug in Session class