adding a delay to prevent lags