fix bug in finish map