Fixed javascript posting wrong data