add required fixes (thanks for the code @turt2live)