To be honest I just copied these lines of code from vhost.pp