error handler

more info :blog.inadram.com