file extension removal not working properly...hoepful fix