Added error catching and button functions

Connor