fixed bug in program