Resolved current_path issue, refactored to not run on every request.