moved use of moment to where it should be used