fixed starvation bug