updated some issues detecting working dir and detecting .py files