fix check function, handle empty drugs input