fixed end of day statement
fixed if statement