added logic for name