fixed a pedante memory override detected by valgrin