removed one sql query.
function for price.