Replace then by and