Fix the code to work