fix various bug with new implementation
update