added some alerts and debugs