trying to fix delay bug