version 3 -adding onpause