fix bugs and add cp seek functionality