bug fixes on sample apps