Added missing if-statement to check if shadows are switched on or off