modified allobject fucntion