implementing the fix sugestion from Artem