add license and fix issue #2