added doc for onDrain