added pauses in an attempt to fix malfunctioning functions