some minor changes and debugs