Added a if else statement, tested everything as well, works as needed.