little tweak for performance improvements - credits to franciscofranco