small changes, catching exceptions