Further changed the verify function