Fixed code to work