fixed memory bug in readpar()