refactoring and fixed incorrect error message
Non-persisting engine work in progress