fixed a bug in moments