implemented a new ser_autodetect funtion
fixed error message ouput (added new line)
added test for autodetect funtionality