Added some basic(ly terrible) error catching