cleanup
remove die()
add invert param