removed https redirect code because of loop