MAAPP javascript modified