code changes according Nagaraja comments