deprecated some functions and replaced the pointer to main form