fixed waitingroom bug
fixed some smelly code