fixing error in code