Added loader and error handler