Check if value is set before checking value