fix pan problem