Added error checking for opting