fixing thread layout problem