added debug codes