Move the extension check under and the prints inside the extention check.