for some reason this lot doesn't work within a function