Changed table names to dynamic