#4 Added more robustness