Added keep_alive callback function functionality