Fix path detection for alternative handler