fix for item 7 report by Ivan Fratric of the Google Security Team