Getting errors in web browser because of class