compilation & runtime error fix