fixed an error in main