added stylus handling