fixed pan bug