Fixing error in main (wrong function)