Added drain function