Fix ugly hack