Added a 1 second delay to avoid the timing issues