Eliminated bug in main.