fixing the crashing.