Added more console logs for debugging