Fixes #2: loading and error handling