change validityTime return to int