fixed few minor bugs