Best is to get access from above if possible and install a proper box.
If getting access from above is not an option, then to consider an old work ceiling fan box similar to this: http://www-public.tnb.com//shared/inst/ta02461-tb2.pdf
A google of old work ceiling fan box will find various options.
If getting access from above is not an option, then to consider an old work ceiling fan box similar to this: http://www-public.tnb.com//shared/inst/ta02461-tb2.pdf
A google of old work ceiling fan box will find various options.