fixed error with random crash added serial functionality changed operation a bit