Added error handler for php errors