last item do not get selected on setting cursor