added error handle and photo field to use schema