Adding pause and resume handlers