move into production block and fix bug