Fixing beforeRequest cancelling issue.