Changed fatal to fail and added log msg
Added unit testing for fail condition