fixed a bug in standalone main