Perhaps some error handling and logging would be useful