this code block is also duplicated above