updated error handling, added STATIC_ROOT_DEBUG