Added more checks and some whitelists