getting rid of nan workaround