Fixed the code - now working