Bug fix: Move the request for is_active and development mode out of the loop.