Adding addition error check for no data being sent to function