added modal layer logic, deciding wether it will have opacity