Fix logic error in ruby robot