use id instead of type