fixed a bug in scaling the signals