Catching strange arrayoutofbounds exception, added directory chooser.