fixed bugs and enhancements