Fix done handler in buffer