validate the object type

add validate here not allow the unauthorized person modify our database