fix critical bug and bump version for 0.2.1 release