Fixes #124, error should be no more.

Added a check to deal with problematic situations. Wrote a comment
current access check method is no good. Need to get it rewritten.