implemented exceptions in lua