Added method check and raise exception
Merge pull request #5 from louiedp3/refactor

Added method check and raise exception