fix loading and rails 3 compatible