Added a if else conditional.