fixed paramater bug in deleting old records