created function to return None instead of exceptions