@NovaliumCompany That code looks ok, so I suppose the cause of your problem is in some other part of your code. BTW, if you do want to ask about this on Stack Overflow or in the
Python room please post your code as (properly formatted) text, not as an image. People want to see code that they can edit & run, you can't easily do that with an image. ;)