Fixed issues with adding close bit to data packet