fix bug in finding file