Finxing problem in last commit: when table is empty the application crash