resolved infinite loop issue