create func, fix exception indent