record for each mode. Added ontouchstart for the buttons