added logic