updated with if let syntax