Another ugly check until I can come up with something better