Add optionals for better error handling