Updated to check for history