Fixed problem with $addMethod