Fixing bug when there is not http origin in url