Added logic for