added in newest bagasmi changes