Adding error handlers and global handlers