adding callback code && resume/pause states