Decoding frames, frame timeout added - very important for error
prone code