Fixing a weird bug