fixed wrong comparison operator