added shake detection