added saving current buffer

closed #49