Moved hour switch into outter "if"