add ability to set layer threshold