Updated logic to account for timing issues