better error handling
enhanced preferences