fixing pan gesture bug