this code block is duplicated as well