fixed null pointer in case of sink