added test code
displays lua error correctly now
proper test function