replaced functions to D7 way