fixed second bug in run main