some fixes or error handling