Fix code error - seems to work now