added method to check if a string is a valid mongo ID