error checking and javascript seperation