prefix key and buffer close function fixed.