adding lua52 compatibility