fixed hang bug