fixed active waiting problem