tablename should be a variable