Fix location submit function