merge #213 credit to @lexware