Working in 64 bit computers

Fixed bug that make if fail when open second time