added validation method in database object