fix empty block bug