fixed check function for correct behavior in comm buffer