Fixed code for the failing test