addMethod bug fixed