fixed issues in main