added debugging log statemtnts