implemented collision with pan edge