Changed index.php to return the object if created successfully.