fixing isNewer function