Fixing maze bug