added retry() for database connection errors
fixed (some) database connection errors