Fixed syntax and checked ip against whitelist

Need to add code for ban on line 43. Changed the if statement to control the function call itself.