Fixed major bug that could lead to form crash