added debugging messages