         submit = (await Submit.findById(req.params.id)).toObject()
         similar = await findSimilarSubmits(submit, 5)
         similar = similar.map((submit) -> submit.toObject())
-        similar = similar.map(expandSubmit)
+        similar = similar.map((s) -> expandSubmit(s))
         similar = await awaitAll(similar)
         similar = similar.map (submit) ->
             return

            submits = submits.map((submit) -> submit.toObject())
            if not req.user?.admin
                submits = submits.map(hideTests)
            submits = submits.map(expandSubmit)
            submits = await awaitAll(submits)
            ws.send JSON.stringify submits


            submits.splice(0, 0, submit0)
            if not req.user?.admin
                submits = submits.map(hideTests)
            submits = submits.map((s) -> expandSubmit(s))
            submits = await awaitAll(submits)
            ws.send JSON.stringify(submits)

