simplified index usage
removed unnecessary check