Fixed another logic bug in the auto-reply script

Fixed another logic bug in the auto-reply script