if clause added for maps script