fixing null timestamp issue