Add checks for Optionals before using them