fixes bug in view_dir check
adds methods for variables