moved bind function to bottom