removed duplicate routine call. removed directory check