fixes infinite loop issue introduced by previous