check for null and assign last rowed