Fixing the empty box error and variable error