added a little safety check