fix wrong conditional statement