start to implement terminate