Well, if it has fallen off several times, the chances are that shaft is now wore and it will never stay. So the mainshaft and 5th gear on the mainshaft is already bad.
cheap option: weld it
little better option: put fresh bearings and synchros and weld it.
best expensive option: new shaft and fresh bearings and synchros. use the nut that has a slit cut in it and a cross bolt to clamp it on the shaft. Loctite is your friend. The nuts with the 2 set screws and brass plugs suck.
Also, welding will make the mainshaft a little weaker.