added the select method with little some extra conditions