added LSM lib with fixed null pointer exception