Updated to handle null results