fixing states on back pressed