Fixes error in tooltip function