Fixes #4585

Fixes http://projects.theforeman.org/issues/4585