Fix based on @wilsonge comment

Welcome
Changes the same as in my previous PR, but now it should be easily merged with asuckar: patch-1
Regards