got the check if tables exist and create working