got rid of nan output error