fixes an embarassing mistake that led to an infinite loop