Removed dangerous and unnecessary code

Removed dangerous and unnecessary code.