add some ugly code