Fixing long wait conditions