Main function bug fixed => remaing: automatic detecting again....