changed error handeling code to work in precentation
Merge origin/master