Avoid PHP notices when objects does not exist