* some extra error handling to prevent NULL dereferences