fix for infinite loading issue