finally big problems are fixed and code is working