Fixed wrong error return