added required filename checking