bugfix in createAvailableLayoutsList mehtod

added condition preventing an infinite while loop on non-existent layout dir