updated bug fix for maze generation