Added method check and raise exception