Added some if-statements, so the code below isn't executed