better error handling when initializing without data