implementation for recording track(not tested yet)