james | adding error handling for database