moved require out after end