fixed test-procedure
initializing error-handling before codeblock execution