added code for adding checkpoint