Added error checking
GUI now works!!!!!!!!!!!!!!