added motion detector