version 1.1: more error handling