fixed packet structure and added in timeout