add license and fix #1