Use appWaitKey instead of waitKey in textview