Added error checking

and built