added header and fixed filtering