set error handler
change to call post code method