Added more hacks to catch redirect to secure url