fixed bug: in sorting sql query for sorting by current magnitudes
Merge remote-tracking branch 'origin/dev'