Fix #8

Move directory existence test before application setup