Added fix described in #3701

added fix from
https://prototype.lighthouseapp.com/projects/8886/tickets/3701