added debug feature