simplified code

should fix base_url issue