Added some robustness and logs!