reverting rpedde's mod from fd73064e0